<header class="navbar navbar-inverse navbar-fixed-top bs-docs-nav" role="banner">
    <div class="container">
        <div class="navbar-header">
            <button class="navbar-toggle" type="button" data-toggle="collapse" data-target=".bs-navbar-collapse">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <div class="navbar-brand">BinWh：Binary Warehouse</div>
        </div>
        <nav class="collapse navbar-collapse bs-navbar-collapse" role="navigation">
            <ul class="nav navbar-nav">
                <li>
                    <a href="/">首页</a>
                </li>
                <li>
                    <a href="http://blog.binwh.com">更多日志</a>
                </li>
                <li>
                    <a href="http://www.weibo.com">微博</a>
                </li>
            </ul>
            <% if (user) { %>
            <ul class="nav navbar-nav navbar-right">
                <li >
                    <a href="#">
                        <%= user.displayName %>
                        (
                        <%= user.emails[0].value %>)</a>
                </li>
                <li>
                    <a href="/logout">退出</a>
                </li>
            </ul>
            <% } %>
            <form class="navbar-form navbar-right" role="search">
                <div class="form-group">
                    <input type="text" class="form-control" placeholder="请输入关键字" id="searchTxt"/>
                </div>
                <button type="submit" class="btn btn-default" id="searchBtn">查询</button>
            </form>
        </nav>
    </div>
</header>

<script type="text/javascript">
    var value = $('#searchTxt').val();

    $('#searchBtn').on('click', function(event) {
        event.preventDefault();
        document.location.href = "/search?q="+$('#searchTxt').val();
    }); 
</script>